package dbOperate

import (
	"github.com/jinzhu/gorm"
)

//测试结构体
type UserInfo struct {
	ID     uint
	Name   string
	Gender string
	Hobby  string
	Byd    string
}

//部门信息表
type DepartmentInfo struct {
	gorm.Model
	UID          string `gorm:"type:varchar(50);unique;not null"` //自定义ID
	Name         string `gorm:"type:varchar(50);not null"`        //部门名，
	DingId       string `gorm:"type:varchar(50);not null"`        //部门钉钉ID
	DingParentId string `gorm:"type:varchar(50);not null"`        //父部门ID
}

//职工信息表
type EmployeeInfo struct {
	gorm.Model
	UID                 string `gorm:"type:varchar(50);unique;not null"` //自定义ID
	Name                string `gorm:"type:varchar(50);not null"`        //姓名，sys00-name
	DingID              string `gorm:"type:varchar(50);not null"`        //钉钉ID
	PrimarydepartmentID string `gorm:"type:varchar(50);not null"`        //主部门ID，sys00-mainDeptId
	DepartmentListID    string `gorm:"type:varchar(50);not null"`        //部门ID列表，sys00-deptIds
	Status              int    `gorm:"not null"`                         //在职状态，sys01-employeeStatus，2，试用，3，正式，5，待离职，-1，无状态
}

//供应商信息
type SupplierInfo struct {
	gorm.Model
	UID     string `gorm:"type:varchar(50);unique;not null"` //自定义ID
	Name    string `gorm:"type:varchar(200);not null"`       //店名称
	Contact string `gorm:"type:varchar(50);not null"`        //联系人
	Address string `gorm:"type:varchar(250);not null"`       //联系地址
	Phone   string `gorm:"type:varchar(200);not null"`       //联系电话,可多个，逗号隔开
}

//设备类别
type DevicesType struct {
	gorm.Model
	UID  string `gorm:"type:varchar(50);unique;not null"` //自定义ID
	Name string `gorm:"type:varchar(50);not null"`        //名称
}

//设备记录
type DevicesInfo struct {
	gorm.Model
	UID          string `gorm:"type:varchar(50);unique;not null"` //自定义ID
	ModifyNum    int    `gorm:"not null"`                         //修改次数，从0开始
	Name         string `gorm:"type:varchar(50);not null"`        //名称
	CustomType   string `gorm:"type:varchar(50);not null"`        //类别
	DepartmentId string `gorm:"type:varchar(50);not null"`        //责任部门ID
	EmployeeId   string `gorm:"type:varchar(50);not null"`        //责任人ID
	SupplierId   string `gorm:"type:varchar(50);not null"`        //供应商ID
	Status       int    `gorm:"not null"`                         //资产状态，-1,无状态，0,闲置，1,在用，2,送修，3,报废
	PicturePath  string //图片路径
	Remark       string //备注
}

//2021设备修改记录
type DevicesLog2021 struct {
	DevicesInfo
}
